package com.itheima.tanhua.dubbo.api;

import com.itheima.tanhua.dubbo.mappers.UserMapper;
import com.itheima.tanhua.model.domain.User;
import com.itheima.tanhua.model.domain.UserInfo;
import com.itheima.tanhua.model.vo.*;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;

@DubboService
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectUserBymobile(String mobile) {
        return userMapper.selectUserBymobile(mobile);
    }


    @Override
    public Long getUserIdByPhone(String phone) {
        return userMapper.getUserIdByPhone(phone);
    }

    @Override
    public void insertUserPhone(LoginVerificationVo loginVerificationVo) {
        userMapper.insertUserPhone(loginVerificationVo);
    }

    @Override
    public void addUserInfo(UserInfo userInfo) {
        userMapper.addUserInfo(userInfo);
    }

    @Override
    public SettingsVo selectUserSettingsById(Long id) {
        return userMapper.selectUserSettingsById(id);
    }

    @Override
    public void insertQuestion(String content, Long id) {
        userMapper.insertQuestion(content, id);
    }

    @Override
    public void saveSetting(SettingsVo vo) {
        userMapper.saveSetting(vo);
    }

    @Override
    public List<BlackListVo> getBlacklist(Long id) {
        return userMapper.getBlacklist(id);
    }

    @Override
    public void deleteBlackList(Integer uid,Long id) {
        userMapper.deleteBlackList(uid,id);
    }

    @Override
    public List<RecommendationVo> getRecommendationVoList(Integer age, String city) {
        return userMapper.getRecommendationVoList(age,city);
    }

    @Override
    public boolean updateUserInfo(UserInfo userInfo) {
        return userMapper.updateUserInfo(userInfo);
    }

    @Override
    public UserInfo getUserInfo(Long userId) {
        return userMapper.getUserInfo(userId);
    }



}
